package com.eva.news.client.core.config.cms;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * 文章详情展示访问次数统计拦截器配置
 */
@Configuration
public class CmsArticleViewCountInterceptorConfig implements WebMvcConfigurer {

    @Resource
    private CmsArticleViewCountInterceptor cmsArticleViewCountInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(cmsArticleViewCountInterceptor)
                .addPathPatterns("/template/data");
    }
}
